<!-- Id Field -->
<div class="form-group">
    {!! Form::label('id', 'Id:') !!}
    <p>{!! $user->id !!}</p>
</div>

<div class="form-group">
    {!! Form::label('name', '昵称:') !!}
    <p>{!! $user->nickname !!}</p>
</div>


<div class="form-group">
    {!! Form::label('', '头像:') !!}
    <p>@tpic($user->avatar_url)</p>
</div>


<!-- Slug Field -->
<div class="form-group">
    {!! Form::label('city', '城市:') !!}
    <p>{!! $user->city !!}</p>
</div>

@if($user->parent)
    <div class="form-group">
        {!! Form::label('parent_id', '上级信息:') !!}
        <p>昵称：{!! $user->parent->nickname?$user->parent->nickname:('无昵称，id:'.$user->parent->id) !!}</p>
    </div>
@else
    <div class="form-group">
        {!! Form::label('parent_id', '上级信息') !!}
        <p>无</p>
    </div>
@endif

@if($user->juniors)
<div class="form-group">
    {!! Form::label('juniors', '下级信息:') !!}
    @foreach($user->juniors as $k=>$junior)
        <p>{{$k+1}}. 昵称：{!! $junior->nickname !!} 头像：@tpic($junior->avatar_url) 时间：{!! $junior->created_at !!} </p>
    @endforeach
</div>
@endif

@if($user->bonuses)
<div class="form-group">
    {!! Form::label('juniors', '优惠券:') !!}
    @foreach($user->bonuses as $k=>$bonuse)
        <p>{{$k+1}}. 
    名称：{!! $bonuse->name !!} 编号：{{$bonuse->sn}} 到期时间：{!! $bonuse->use_end_date !!} 使用时间：{!! $bonuse->use_date !!}  状态：{!! $bonuse->use_status==1?'已用':'未用' !!}</p>
        </p>
    @endforeach
</div>
@endif
{{--<button id="add_Modal">添加优惠券</button>--}}
{{--<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" style="font-size: 12px">--}}
    {{--添加优惠券--}}
{{--</button>--}}

@if($user->addresses)
<div class="form-group">
    {!! Form::label('address', '地址信息:') !!}
    @foreach($user->addresses as $address)
        <p>地址：{!! $address->address !!} 收货人：{!! $address->name !!} 电话：{!! $address->phone !!}</p>
    @endforeach
</div>
@endif

@if($user->roles)
    <div class="form-group">
        {!! Form::label('roles', '角色:') !!}
        @foreach($user->roles as $k=>$role)
            <p>{{$k+1}}.
                角色名称：{!! $role->name !!} 角色描述：{{$role->desc}}
            </p>
        @endforeach
    </div>
@endif


<!-- Created At Field -->
<div class="form-group">
    {!! Form::label('created_at', 'Created At:') !!}
    <p>{!! $user->created_at !!}</p>
</div>

<!-- Updated At Field -->
<div class="form-group">
    {!! Form::label('updated_at', 'Updated At:') !!}
    <p>{!! $user->updated_at !!}</p>
</div>


@section('scripts')
    <script>
        $('#add_Modal').on('shown.bs.modal', function () {
            $('#myInput').focus()
        })
    </script>
@endsection
